package com.kylin.core.user.query.handler;

import com.kylin.dal.entity.user.UserAddressEntry;
import com.kylin.domain.user.vo.UserAddressVO;
import com.kylin.shared.utils.MappingTools;
import com.kylin.user.api.dto.resp.UserAddressRespDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 用户地址对象转换类
 * @author Damon S.
 * @version v1.0.1
 * @date 2020年12月30日 19:29
 */
@Mapper(componentModel = "spring", uses = MappingTools.class)
public interface AddressTranslator {

    @Mapping(source = "id", target = "addressId")
    UserAddressVO toUserAddressVO(UserAddressEntry entry);

    UserAddressRespDTO toUserAddressRespDTO(UserAddressVO vo);
}
